import request from '@/utils/request'
// 获取文章列表
export function test(params) {
  return request({
    url: '/articles',
    method: 'GET',
    params
  })
}
// 删除文章
export function deldatil(id) {
  return request({
    url: `/articles/${id}`,
    method: 'DELETE'
  })
}
// 文章状态
export function statemsg(id, state) {
  return request({
    url: `/articles/${id}/${state}`,
    method: 'POST'
  })
}

// 新增文章

export function addmsg(data) {
  return request({
    url: `/articles`,
    method: 'POST',
    data
  })
}
// 修改文章
export function editmsg(data) {
  console.log(data.id)
  console.log(data, '1231231231231231231')
  return request({
    url: `/articles/${data.id}`,
    method: 'PUT',
    data
  })
}

export function getmsg(data) {
  console.log(data.id)
  console.log(data, '1231231231231231231')
  return request({
    url: `/articles/${data.id}`,
    method: 'GET',
    params: data
  })
}
